<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>绑定手机号码</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="__INDEX__amazeui/css/amazeui.min.css"/>
<link rel="stylesheet" href="__INDEX__default/style.css"/>
<script src="__INDEX__amazeui/js/jquery.min.js"></script>
<script src="__INDEX__amazeui/js/amazeui.min.js"></script>
</head>

<body>
<div class="container">
	<header data-am-widget="header" class="am-header am-header-default my-header">
      <div class="am-header-left am-header-nav">
        <a href="#left-link" class="">
          <i class="am-header-icon am-icon-chevron-left"></i>
        </a>
      </div>
      <h1 class="am-header-title">
        <a href="#title-link" class="">绑定手机</a>
      </h1>
      <div class="am-header-right am-header-nav">
        <a href="#right-link" class="">
          <i class="am-header-icon  am-icon-home"></i>
        </a>
      </div>
    </header>
    <div class="cart-panel">
		<form class="am-form my-form" method="post" action="{:url('bindPhone')}">
            <div class="am-form-group am-form-icon">
                <i class="am-icon-user" style="color:#329cd9"></i>
                <input type="text" class="am-form-field  my-radius" name="phone" placeholder="请输入您的手机号码">
            </div>

            <div class="am-form-group am-form-icon" style="overflow: hidden">
                <div class="am-u-md-4">
                    <img src="{:url('captcha')}" alt="" id="captcha" style="cursor: pointer;">
                </div>
                <div class="am-u-md-8">
                    <input type="text" class="am-form-field  my-radius" name="captcha" placeholder="请输入验证码">
                </div>
            </div>
            <div class="am-form-group am-form-icon" style="overflow: hidden">
                <div class="am-u-md-4">
                    <button type="button" id="send">发送手机验证码</button>
                </div>
                <div class="am-u-md-8">
                    <input type="text" class="am-form-field  my-radius" name="phonecode" placeholder="请输入验证码">
                </div>
            </div>

            <p class="am-text-center"><button type="submit" class="am-btn am-btn-danger am-radius am-btn-block">提交</button></p>
        </form>
    </div>
    
    <footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }">
        <hr data-am-widget="divider" style="" class="am-divider am-divider-default"/>
      <div class="am-footer-miscs ">
        <p>CopyRight©2014 AllMobilize Inc.</p>
        <p>京ICP备13033158</p>
      </div>
    </footer>
    <!--底部-->
    <div data-am-widget="navbar" class="am-navbar am-cf my-nav-footer " id="">
      <ul class="am-navbar-nav am-cf am-avg-sm-4 my-footer-ul">
        <li>
          <a href="/wap/" class="">
            <span class="am-icon-home"></span>
            <span class="am-navbar-label">首页</span>
          </a>
        </li>
        <li>
          <a href="###" class="">
            <span class=" am-icon-phone"></span>
            <span class="am-navbar-label">电话</span>
          </a>
        </li>
        <li>
          <a href="###" class="">
            <span class=" am-icon-comments"></span>
            <span class="am-navbar-label">聊天</span>
          </a>
        </li>
        <li>
          <a href="#" class="">
            <span class=" am-icon-map-marker"></span>
            <span class="am-navbar-label">地图</span>
          </a>
        </li>
        <li style="position:relative">
          <a href="javascript:;" onClick="showFooterNav();" class="">
            <span class="am-icon-user"></span>
            <span class="am-navbar-label">会员</span>
          </a>
          <div class="footer-nav" id="footNav">
          	<span class=" am-icon-bank"><a href="#">买家中心</a></span>
            <span class="am-icon-suitcase"><a href="#">卖家中心</a></span>
            <span class="am-icon-usd"><a href="#">我的钱包</a></span>
            <span class="am-icon-user"><a href="#">个人资料</a></span>
            <span class="am-icon-th-list"><a href="#">帮助中心</a></span>
            <span class="am-icon-comments"><a href="#">消息中心</a></span>
            <span class="am-icon-power-off"><a href="#">安全退出</a></span>
          </div>
        </li>
      </ul>
      <script>
	  	function showFooterNav(){
			$("#footNav").toggle();

		}

		$('#captcha').click(function () {
            $(this).attr('src' , $(this).attr('src').split('?')[0]+'?id='+Math.random());
        })
            var T;
          $('#send').click(function () {
              $(this).prop('disabled' , true);
              $(this).html('<span id="num">60</span>秒后再发送');
              T = setInterval(function () {
                var num = $('#num').html()
                  num--;
                if (num <= 1) {
                    $('#send').html('发送手机验证码');
                    $('#send').prop('disabled' , false);
                    clearInterval(T)
                }else {
                    $('#num').html(num);
                }
              } , 1000);

              var fd = new FormData($('.my-form')[0]);
              $.ajax({
                  type: 'post' ,
                  data : fd,
                  url:'{:url('checkPhoneCode')}',
                  contentType: false, // 注意这里应设为false
                  processData: false,
                  success : function (res) {

                  }
              })
          })
	  </script>
    </div>
</div>
</body>
</html>
